@use 'design-system' as *;

.form :global(.alert) {
    margin: 0 0 6px;
}

.form h1,
.form h2,
.form h3,
.form h4 {
    display: flex;
    align-items: center;
    gap: $spacing-size-2;
}

.licenceWrapper {
    margin-top: $spacing-size-2;
    position: relative;
}

.license,
.licencePlaceholder {
    width: 100%;
    height: 14.2em;
    padding: $spacing-size-4;
    word-break: break-all;
    font-family: var(--text-monospace-font-family);
    font-size: 15px;
    line-height: var(--text-lh-base);
}

.license {
    resize: none;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--color-border-secondary), var(--color-border-primary));
    background-color: var(--color-bg-secondary);
    color: var(--color-fg-secondary);

    &::placeholder {
        opacity: 0;
    }

    #{$selector-darkmode} & {
        background-color: var(--color-bg-tertiary);
    }
}

.licencePlaceholder {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;

    span {
        opacity: 0.5;
    }
}

.licenseData {
    display: flex;
    flex-direction: column;
    gap: $spacing-size-4;
    margin-top: $spacing-size-4;
}

.expired {
    color: var(--color-negative);
}

.frameworkLogo {
    width: $spacing-size-6;
    height: $spacing-size-6;
    border-radius: var(--radius-xs);
}

.configureItems {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: $spacing-size-3 $spacing-size-8;
    margin-top: $spacing-size-2;

    label {
        display: flex;
        align-items: center;
        gap: $spacing-size-3;
    }
}

.error {
    border: 1px solid var(--color-input-error);
    background-color: var(--color-util-warning-100);
}

.results {
    margin-top: $spacing-size-8;

    h2 {
        margin-top: $spacing-size-12;
    }
}

.reposTable {
    thead {
        line-height: 1.2;
        vertical-align: bottom;
    }

    th:first-child,
    td:first-child {
        padding-left: 0;
    }

    td {
        vertical-align: middle;
        text-transform: capitalize;
    }

    .frameworkLogo {
        margin-right: $spacing-size-1;
    }

    @media screen and (max-width: 900px) {
        thead {
            display: none;
        }

        tr,
        td {
            display: block;
            text-align: left;
        }

        tr {
            padding: $spacing-size-4 0;

            &:nth-child(even) {
                background-color: unset;
            }
        }

        td {
            padding: 0;
            line-height: var(--text-lh-tight);
            font-weight: var(--text-bold);

            &:not(:last-child) {
                margin-bottom: $spacing-size-2;
            }
        }

        td[data-column]::before {
            content: attr(data-column) ': ';
            font-weight: var(--text-regular);
            color: var(--color-fg-secondary);
        }
    }

    @media screen and (min-width: 900px) {
        th:last-child,
        td:last-child {
            padding-right: 0;
            text-align: right;
        }

        [data-column='GitHub Repo'] {
            width: 280px;
        }

        [data-column='Framework'] {
            width: 140px;
        }
    }

    @media screen and (min-width: 1600px) {
        [data-column='License Type'] {
            width: 160px;
        }
    }
}

.repoButton {
    > svg:global(.icon) {
        --icon-size: 1.5em;

        position: relative;
        right: 4px;
    }
}
